/*
 * Copyright (c) 2025, 大连理工大学 (Dalian University of Technology)
 *
 * Licensed under the Mulan PSL v2.
 * You can use this file according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of the License at
 *
 *     http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. SEE THE MULAN PSL v2
 * FOR MORE DETAILS.
 */

/*
 * @Author: qiulin 1746365080@qq.com
 * @Date: 2024-11-05 14:22:29
 * @LastEditors: qiulin_JXGM ql1746365080@gmail.com
 * @LastEditTime: 2024-12-06 15:16:43
 * @FilePath: /SGSim/DBManager/Repository/HDF5/Input/Constraint/TEMPRepository.h
 */
#pragma once

#include <cstddef>

#include "highfive/H5DataType.hpp"
#include "highfive/bits/H5DataType_misc.hpp"

#include "DataStructure/Common/Integer.h"
#include "DataStructure/Common/Real.h"
#include "DataStructure/Input/Constraint/TEMPData.h"

#include "DBManager/Common/DBManagerNamespace.h"
#include "DBManager/Database/HDF5Database.h"
#include "DBManager/IRepository/Input/Constraint/ITEMPRepository.h"
#include "DBManager/Repository/HDF5/Base/SingleSetRepositoryBase.h"
template <>
inline HighFive::DataType HighFive::create_datatype<SG::DataStructure::FEM::TEMPData> ()
{
    HighFive::CompoundType compoundType = {
        { "SID", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
        { "G", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
        { "T", HighFive::create_datatype<SG::DataStructure::Common::Real> () },
        { "DOMAIN_ID", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
    };
    return compoundType;
}

SG_DBMANAGER_HDF5_NAMESPACE_OPEN
class TEMPRepository : public ITEMPRepository, public SingleSetRepositoryBase<SG::DataStructure::FEM::TEMPData>
{
  public:
    explicit TEMPRepository (HDF5Database& database);

    void InitialDatasetInfo () override;
};
SG_DBMANAGER_HDF5_NAMESPACE_CLOSE